﻿using DXApplication1.cls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace DXApplication1
{
    /// <summary>
    /// WindowChart.xaml 的交互逻辑
    /// </summary>
    public partial class WindowChart : Window
    {
        Friends Friend;
        public WindowChart(Friends fri)
        {
            InitializeComponent();
            Friend = fri;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            imgAvatar.Source = new BitmapImage(new Uri(Friend.Avatar,UriKind.Relative));
            txtName.Text = Friend.Name;
            txtSign.Text = Friend.Sign;
        }

        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }

        private void imgClose_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }

        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void imgMaxsize_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (WindowState == WindowState.Maximized)
            {
                this.WindowState = WindowState.Normal;
            }
            else
            {
                this.WindowState = WindowState.Maximized;
            }
        }

        private void imgMiniSize_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.WindowState = WindowState.Minimized;
        }
    }
}
